package com.allwees.bs.c.module.product.dto;

import com.allwees.bs.c.module.merchant.dto.StoreDTO;
import com.allwees.bs.c.module.product.entity.ProductEntity;
import com.allwees.bs.c.module.product.vo.DispalyVO;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;

/**
 * 商品数据传输对象
 */

@Data
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
public class ProductDetailsDTO extends ProductSimpleDTO implements DispalyVO {

	private static final long serialVersionUID = -6625717263035484479L;

	private int displayAs = DISPLAY_AS_1;

	private StoreDTO store;

	private SKUWrapper skus = new SKUWrapper();

	private Boolean userIsCollection;

	private Boolean userIsOrder;

	private BigDecimal minRetailPrice;

	private BigDecimal maxRetailPrice;

	private BigDecimal minOriginalPrice;

	private BigDecimal maxOriginalPrice;


	public ProductDetailsDTO(ProductEntity product) {
		this(product, false);
	}

	public ProductDetailsDTO(ProductEntity product, boolean fullMode) {
		super(product, fullMode);
	}

	public ProductDetailsDTO filter(boolean fullMode) {
		if(!fullMode) {
			setPhotos(null);
			setStatus(null);
			setKeywords(null);
			setDescription(null);
			setStore(null);
		}
		return this;
	}
}
